<?php

/**
 * DZTProduct form.
 *
 * @package    DZTidjara
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class DZTProductForm extends BaseDZTProductForm
{
  public function configure()
  {
    parent::configure();
  
    unset($this['created_at'], $this['updated_at']);
    
    $this->widgetSchema['description'] = new sfWidgetFormTextareaTinyMCE();
    
    $this->widgetSchema['category_id'] = new sfWidgetFormSelect(array(
                                                                       'choices' => Doctrine::getTable('DZTCategory')->findAll(),
                                                                       'default' => 'BC'
                                                                     ));
    
    $this->widgetSchema['photo_url'] = new sfWidgetFormInputFileEditable(array(
                                                                            'label'     => 'Company logo',
                                                                            'file_src'  => '/uploads/images/DZTproduct/' . $this->getObject()->getId() . '-' . $this->getObject()->getName(),
                                                                            'is_image'  => true,
                                                                            'edit_mode' => !$this->isNew(),
                                                                            'template'  => '<div>%file%<br />%input%<br />%delete% %delete_label%</div>',
                                                                          ));

  }
}
